package com.lagou.homework1_4;

import java.util.Scanner;

public class EmployeeTest {

    public static void main(String[] args) {

        Employee e = new Employee();
        try {
            e.setName("");
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            System.out.println("name=\"\" 出现了空指针异常");
            try {
                e.setName(null);
            } catch (Exception ex) {
                ex.printStackTrace();
            } finally {
                System.out.println("name=null 出现了空指针异常");
                try {
                    e.setAge(11);
                } catch (Exception ex) {
                    ex.printStackTrace();
                } finally {
                    System.out.println("年龄小于15出现自定义年龄异常");
                    try {
                        e.setAge(151);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    } finally {
                        System.out.println("年龄大于150出现自定义年龄异常");
                    }
                }
            }
        }
    }
}

